// dart 中的继承

class Enemy {
  var x, y;

  Enemy(this.x, this.y);

  fly() {
    print("飞到x=$x, y=$y 位置");
  }

  @override
  String toString() {
    return "Enemy { x: $x, y: $y}";
  }

}

class Plane extends Enemy {
  var score;
  Plane(x, y, score):
    this.score = score,
    super(x, y);

  getScore() {
    print("击落敌机，得 $score 分。");
  }

  @override
  String toString() {
    return "Plane { x: $x, y: $y, score: $score}";
  }
  
}


void main() {
  var p1 = Plane(50, 100, 5);
  p1.fly();
  p1.getScore();
}
